Handling unexpected responses to script executing in client-side application

ABSTRACT

Handling unexpected response messages at a client-side application such as a web browser, where those responses require the client-side application to issue an unexpected prompt and are triggered by request messages sent from script executing in the client-side application. A widget is dynamically constructed to provide the prompt to a user. Display and processing of the widgets and prompts is handled in a non-disruptive manner in an environment where a gateway function requesting the prompt may be interposed between a browser and a server in a network, and where the browser script may adhere to the Ajax methodology.

BACKGROUND

The present invention relates to computing systems, and deals moreparticularly with handling unexpected responses received in a clientapplication such as a web browser, where the responses require theclient-side application to issue an unexpected prompt and are triggeredby requests from script executing in the client-side application.

In early scenarios involving web browsers and web servers, the contentsent from the web server to the web browser comprised an entire webpage. See FIG. 1, where components and flows of this approach areillustrated. As shown therein, a web browser 100 displays a web page(not shown in FIG. 1), and this web page sends 111 a request 110 forrefreshed content. The request is received at a web application server150, which processes 160 the request and sends 161 a revised web pageback to the browser 100. Upon receiving the revised web page, thebrowser 100 refreshes the displayed page by loading 120 the responsereceived from the server 150. While this approach was functional, it wasdetermined to be undesirable when only a portion of the web page contentwas changed. As one problem with this existing approach, it wassometimes inconvenient or unpleasant for a user to view the frequentreloading (i.e., redisplaying) of the entire web page, because thereloading could cause what is referred to as a “screen flicker”phenomenon, where the page content appears to be flashing as itdisappears for a moment and then reappears (i.e., due to the redisplay).As another problem, repeatedly sending the entire web page from the webserver to the web browser often led to excessive bandwidth use fornetwork transmissions.

BRIEF SUMMARY

The present invention is directed to handling unexpected content at aclient-side application. In one aspect, this comprises: receiving, at aclient-side application responsive to a request sent by the client-sideapplication, a response message; and responsive to determining, at theclient-side application, that the response message is not in an expectedformat (such as web page content in HyperText Markup Language format),creating a user input frame, inserting content from the response messageinto the user input frame, obtaining a user response from the user inputframe, and returning the obtained user response to a sender of theresponse message. This aspect preferably further comprises dynamicallymodifying the response loaded in the user input frame to submit, to thesender of the response message, through an Ajax handler in the clientapplication (such that a subsequent response will return to the Ajaxhandler in the client application).

Embodiments of these and other aspects of the present invention may beprovided as methods, systems, and/or computer program products. Itshould be noted that the foregoing is a summary and thus contains, bynecessity, simplifications, generalizations, and omissions of detail;consequently, those skilled in the art will appreciate that the summaryis illustrative only and is not intended to be in any way limiting.Other aspects, inventive features, and advantages of the presentinvention, as defined by the appended claims, will become apparent inthe non-limiting detailed description set forth below.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The present invention will be described with reference to the followingdrawings, in which like reference numbers denote the same elementthroughout.

FIG. 1 illustrates components and flows of early scenarios involving webbrowsers and web servers, according to the prior art;

FIG. 2 illustrates component and flows of a scenario where a gatewayprotects access to resources of a web application server, according tothe prior art;

FIG. 3 illustrates components and flows involving web browsers and webservers exchanging messages triggered by browser script, according tothe prior art;

FIG. 4 illustrates component and flows of a scenario where a gatewayprotects access to resources of a web application server communicatingwith a web browser that sends messages triggered by browser script,according to the prior art;

FIG. 5 illustrates component and flows of a scenario where a gatewayprotects access to resources of a web application server communicatingwith a web browser that sends messages triggered by browser script,according to a preferred embodiment of the present invention;

FIG. 6 illustrates an example scenario where the gateway of FIG. 5detects that the browser script has requested a protected resource, andtherefore intervenes to prompt the user for additional informationbefore allowing the request to be forwarded to the web applicationserver, according to a preferred embodiment of the present invention;

FIG. 7 depicts a data processing system suitable for storing and/orexecuting program code; and

FIG. 8 depicts a representative networking environment in which one ormore embodiments of the present invention may be used.

DETAILED DESCRIPTION

The present invention is directed to handling unexpected responsemessages at a client-side application such as a web browser, where thoseresponses require the client-side application to issue an unexpectedprompt and are triggered by request messages sent from script executingin the client-side application. Hereinafter, the client-side applicationis referred to as a browser, although this is by way of illustration andnot of limitation. The browser script may be written using AsynchronousJavaScript and XML (although this is by way of illustration but not oflimitation). Asynchronous JavaScript and XML is commonly referred to as“AJAX” or “Ajax”, and generally connotes a set of methods that areusable for providing interactive web applications. (It should be notedthat Ajax technology has evolved since its inception, and use ofJavaScript and XML are no longer strictly required. Other scriptinglanguages may be used instead of JavaScript, and notations other thanXML may be used for data interchange, and such alternatives may beconsidered to be a form of Ajax technology.)

A server acting as a gateway may be deployed between a web browser and aweb application server in a networking environment. The gateway may beused to protect access to particular resources or actions of theapplication server, and this protection may be based on resource name,request parameters, and/or other types of rules. When the gatewayprovides this type of access protection, a protected resource requestedby the browser is not immediately returned to the browser. Instead, thegateway responds to the web browser request with a request foradditional information. For example, if the application server storese-mail messages, the gateway may be responsible for obtaining an e-mailuser's address and password before allowing the browser application toaccess the e-mail messages stored on the application server, and thegateway may therefore respond to the web browser request by sending thebrowser a gateway-initiated request to prompt the user for the user'saddress and password. As another example, the web application servermight host a contest application, where the contest is only open tousers who are at least a certain age. In this scenario, the gateway mayrespond to a browser request to access the contest by sending thebrowser a gateway-initiated request to prompt the user to provide his orher birth date. In yet another example, the gateway may be configured tomonitor outbound requests from a home network, and to solicit parentalapproval prior to passing selected requests on to the Internet (usingrules that are not necessarily specific to a particular webapplication). In a still further example, the gateway might determinethat payment is required before a particular web page can be displayed,and may then require payment information from the user before allowing aconnection request to be transmitted to the particular web page. Theseexamples are illustrative but not limiting of the types of additionalinformation which may be requested. It may also happen that the gatewayis configured to respond to a browser request with a gateway-initiatedrequest for a user confirmation of some type—such as requesting the userto press a graphical “OK” button to confirm that he or she wishes toproceed—rather than specifically requesting additional information fromthe user. Thus, references herein to obtaining additional informationfrom the user and to obtaining confirmation from the user are intendedto be different forms of the same client-side prompting scenario. Itshould also be noted that the requests which are intercepted by thegateway do not need to be known in advance to the client application,and the timing of such intercepted requests also does not need to beknown in advance.

FIG. 2 illustrates component and flows of the above-described scenariowhere a gateway 220 is placed between browser 200 and web applicationserver 250. Similar to FIG. 1, web browser 200 is again displaying a webpage, and this web page sends a request 201 for refreshed content. InFIG. 2, the request 201 is sent 202 to the gateway 220. Upon receivingthe request at the gateway 220, the gateway checks 221 to see if thisrequest 201 requires some type of user confirmation. (Hereinafter,discussions of checking to see if the browser's request requiresconfirmation should be interpreted as checking instead, or in addition,to see if the browser request is for a protected resource.) Typically,gateway 220 stores a list or other structure, identifying the resourcesof application server 250 that require confirmation (or alternatively,identifying requests for which the gateway will provide accessprotection). Accordingly, the test at Block 221 typically compriseschecking the incoming request 201 against the stored list or otherstructure.

When gateway 220 determines that the request 201 does not requireconfirmation (i.e., the test at Block 221 has a negative result), therequest is forwarded 222 from gateway 220 to the web application server250, which processes 251 the request and sends 252 a revised web pageback to the browser 200 in a similar manner to the processingillustrated in FIG. 1, after which the browser 200 refreshes thedisplayed page by loading 215 the response received from the server 250.

On the other hand, when gateway 220 determines that the request 201 doesrequire confirmation (i.e., the test at Block 221 has a positiveresult), this indicates that the gateway needs to intercept the requestand obtain additional information from the browser before the gatewaywill forward the request to the web application server 250. Accordingly,the gateway creates a response message 223 that contains a request forthe confirmation (or alternatively, a request for additionalinformation), and sends 224 this response message to the browser 200.The gateway-initiated request is referred to in FIG. 2 as a“confirmation prompt” for ease of reference, and this term is usedherein to refer to a prompt which is displayed by the browser to enablea user to provide a confirmation or to provide some type of additionalinformation. Providing a confirmation may comprise, for example,pressing an “OK” graphical button responsive to reading and accepting amessage that is provided in the confirmation prompt, wherein thisgraphical button is also rendered in the confirmation prompt.

Upon receiving the response message 223 at browser 200, the browserrefreshes the currently-displayed page by loading 210 the confirmationprompt received from gateway 220. User input 211 is then received,responsive to the display of the confirmation prompt. A new requestmessage 212 is created from the user's response, and this message isthen sent 232 from the browser 200 back to gateway 220. Gateway 220determines that this incoming message 212 provides the confirmation (oradditional information, alternatively) that was requested by message223. A verification process 230 is typically performed, whereby thegateway determines whether the information in the user's response isapproved. If it is not approved (i.e., the test in Block 230 has anegative result), then processing returns to Block 223 to send anothermessage to the browser, as shown by reference number 231. On the otherhand, if the information in the user's response is approved (i.e., thetest in Block 230 has a positive result), then gateway 220 preferablyforwards 233 the original request for a protected resource to the webapplication server 250. Web application server 250 processes 251 therequest and sends 252 a revised web page back to the browser 200 in asimilar manner to the processing illustrated in FIG. 1, after which thebrowser 200 refreshes the displayed page by loading 215 the responsereceived from the server 250.

The approach illustrated in FIG. 2 is functionally sufficient forscenarios where the browser 200 is requesting an entire web page fromthe application server 250, because the gateway's requested confirmationprompt 223 can also be presented 210 in browser 200 as a web page.However, as discussed earlier, transmitting entire web pages andreloading entire web pages has drawbacks in some scenarios. More modernapproaches to refreshing web page content therefore allow for reloadinga selected portion (or portions, equivalently) of a currently-displayedweb page while remaining portions are not reloaded. This reduces thescreen flicker phenomenon and also reduces network bandwidth usage.

Use of browser script within web pages is one technique for reloading aselected portion of a web page, allowing a browser to support aninteractive web application that sends requests for updated contentportions to a web application server and then reloads the portion of theweb page with the updated content received from the server. Theabove-discussed Ajax technology is often used in today's webapplications, and subsequent discussions herein refer to browser scriptthat retrieves data using Ajax technology. An Ajax request from aclient-side application might be formatted, for example, using syntaxsuch as ‘http://server/servletAction?queryTerm=“someValue”’, and aresponse to this query may comprise a markup language document or astring that the client application is adapted for processing.Alternative implementations that use technology other than Ajax toachieve the functionality described herein are considered to fall withinthe scope of the present invention, however.

FIG. 3 illustrates components and flows of an interactive webapplication that uses Ajax for browser script support. As shown therein,a web browser 300 displays a web page (not shown in FIG. 3) that usesAjax, and this web page sends 302 a request 301 for refreshed contentfor a selected portion of the currently-displayed web page. The requestis received at a web application server 350, which processes 351 therequest and sends 352 revised web page content back to the browser 300.Upon receiving the revised web page content, the browser 300 uses Ajaxsupport to process 310 the response (which may comprise refreshing aselected portion of the displayed page by loading the response receivedfrom the server 350 into that portion of the web page).

The approach shown in FIG. 3 is functional and suitable in many cases.However, when resources at the web application server 350 need to beaccess protected through a gateway, several problems may arise, as willnow be described with reference to the components and flows illustratedin FIG. 4.

Referring now to FIG. 4, web browser 400 is again displaying a web pagethat uses Ajax, and browser script executing in this web page sends arequest 401 for refreshed content for a selected portion of thecurrently-displayed web page. In contrast to FIG. 3, the request 401 ofFIG. 4 is sent 402 to gateway 420. Upon receiving the request at thegateway 420, the gateway checks 421 to see if this request 401 requiresconfirmation. Typically, the test at Block 421 comprises gateway 420checking the incoming request 401 against a stored list or otherstructure.

When gateway 420 determines that the request 401 does not requireconfirmation (i.e., the test at Block 421 has a negative result), therequest is forwarded 422 from gateway 420 to the web application server450, which processes 451 the request and sends 452 revised web pagecontent back to the browser 400 in a similar manner to the processingillustrated in FIG. 3, after which the browser 400 processes 415 theresponse using Ajax (which may comprise refreshing a selected portion ofthe displayed page by loading the response received from the server 450into that portion of the web page).

On the other hand, when gateway 420 determines that the request 401 doesrequire confirmation (i.e., the test at Block 421 has a positiveresult), this indicates that the gateway needs to intercept the requestand obtain additional information from the browser before the gatewaywill forward the request to the web application server 450. Accordingly,the gateway creates a response message 423 that contains a request forthe additional information, and sends 424 this response message to thebrowser 400.

A first problem arises, however, because of the need to present thegateway-requested confirmation prompt in a non-disruptive way, using theoriginal format of the confirmation request. If the gateway requests amonth, date, and year of the user's birth, for example, then theconfirmation prompt should be formatted to obtain each of these piecesof information. It is impractical to code the browser application with astatic set of predetermined, prebuilt graphical user interface promptwidgets on the expectation that the gateway-initiated requests will onlyask for information that can be obtained using this set of promptwidgets. As one illustration of problems inherent in using prebuiltprompt widgets that support a static set of predetermined requests, thebrowser script might be coded to respond to a gateway request for apassword by displaying a password prompt widget that accepts the user'sinput. However, if the gateway was subsequently changed to ask for aCAPTCHA confirmation (i.e., a confirmation that uses an image which canbe interpreted by a human but is difficult for a machine to interpret,thereby preventing automated security attacks) instead of or in additionto a password, the browser script would be unable to handle this newconfirmation request without rewriting at least some portion of thescript. The browser may therefore be unable to translate the CAPTCHAconfirmation request into anything that can be prompted through the userinterface. This problem is illustrated at reference number 410 in FIG.4, which notes that unexpected content in the gateway request 423 maycause errors at the browser.

More generally, providing a static set of prebuilt prompt widgetspresumes an application-specific link between a browser script and agateway. A more generic, application-independent gateway model ispreferred, whereby a gateway may be used with different web applicationsand therefore dynamically determines the needed content for confirmationprompts. Embodiments of the present invention therefore do not assumethat the gateway is specifically configured for access protection of anyparticular web application.

An embodiment of the present invention also provides flexibility in howthe gateway determines whether a confirmation prompt is needed. Forexample, in addition to or instead of checking the browser-initiatedrequest against a list of protected resources, the gateway might beconfigured to scan incoming browser requests for some combination orpattern of parameter values and to issue a confirmation request inresponse to detection thereof. When using parameter values as a criteriafor requesting a confirmation prompt, the number of parameters and/orthe value of parameters checked by the gateway may change relativelyfrequently, and a statically-defined set of prompt widgets is thereforenot suitable.

Note also that there may be instances where a list of the resourcesprotected by a gateway is not readily available to web applicationdevelopers, thus preventing the developers from creating a set of promptwidgets specifically directed to supporting expected confirmation promptrequests from the gateway. The list of protected resources may also notbe readily available to script developers, thus preventing them fromwriting script that handles protected resources differently from otherresources. Accordingly, a preferred embodiment of the present inventionhandles confirmation prompt requests from a gateway without priorknowledge of the content and/or format of such prompt requests.

Referring again to the scenario illustrated in FIG. 4, a second problemarises relative to receipt of the protected resource originallyrequested by the browser script. Assuming that a suitable prompt widgetis used to prompt the user, and that the additional information providedby the user is successfully verified by the browser, then theoriginally-requested resource will be returned to the browser from theweb application server. However, when using existing techniques,displaying the prompt widget may have changed the focus of the userinterface, and it is undesirable for the returned resource to bedisplayed wherever the focus now happens to be. Or, the resource mightnot be intended for display, but rather for interpretation by thebrowser script. Accordingly, the returned resource should be processedby a browser script function that is written for that purpose and whichis expecting to received the returned resource in response to thebrowser script's original request (i.e., the request that caused thegateway to send the confirmation prompt message). Accordingly, apreferred embodiment of the present invention returns the requestedresource to the normal Ajax flow when the configuration prompt issuccessful.

A third problem arises in the scenario depicted in FIG. 4 when theoriginal flow of the browser script is disrupted. That is, when the userprovides input responsive to a prompt widget, the user may press an“Enter” graphical button or similar graphical control to signify thatentry of the requested additional information is finished. When usingexisting techniques, this signal will typically only apply to the promptwidget, however, which leaves the underlying browser script without asignal that it is time to transmit the obtained additional informationto the gateway. The obtained additional information is therefore notsent to the gateway, as indicated at reference numbers 411, 432 of FIG.4. In turn, gateway 420 has nothing to verify or approve at Block 430,and will therefore not exercise paths 431, 433. Requiring the user toperform some additional action, such as explicitly requesting a retry orpressing another “Enter” graphical button, to trigger the sending of theobtained additional information to the gateway is undesirable.Accordingly, a preferred embodiment of the present invention ensuresthat the obtained additional information is forwarded to the gateway ina manner that is transparent to the user, and that is also transparentto the flow of the browser script, such that processing within thebrowser script resumes where it left off following the request for theprotected resource.

A fourth problem may arise in the scenario of FIG. 4 when portions ofthe currently-displayed web page are asynchronously refreshed. If theconfirmation prompt widget is displayed in an area of the graphical userinterface which is then asynchronously refreshed, the prompt widget maybe overlaid when using existing techniques. Accordingly, a preferredembodiment of the present invention isolates the request for additionalinformation from other content in the browser.

Referring now to FIG. 5, components and flows are illustrated for anembodiment of the present invention. A gateway 520 is placed between aweb application server 550 and a web browser 500 which sends messagestriggered by browser script. Web browser 500 is displaying a web pagethat uses Ajax, and browser script executing in this web page sends arequest 501 for refreshed content. In FIG. 5, the request 501 is sent502 to the gateway 520. Upon receiving the request at the gateway 520,the gateway checks 521 to see if this request 501 requires confirmation(or otherwise requires additional information). This preferablycomprises gateway 520 checking the request 501 against a list or otherstructure in which criteria for requiring a confirmation prompt arestored, as discussed earlier.

When gateway 520 determines that the request 501 does not requireconfirmation (i.e., the test at Block 521 has a negative result), therequest is forwarded 522 from gateway 520 to the web application server550, which processes 551 the request and sends 552 the requested contentback to the browser 500 for processing by an Ajax handler at 510.

On the other hand, when gateway 520 determines that the request 501 doesrequire confirmation (i.e., the test at Block 521 has a positiveresult), this indicates that the gateway needs to intercept the requestand obtain additional information from the browser before the gatewaywill forward the request to the web application server 550. Accordingly,the gateway creates a response message 523 that contains a request forthe confirmation (or alternatively, a request for additionalinformation), and sends 524 this response message to the browser 500 forprocessing by the Ajax handler at 510. The confirmation prompt response523 preferably comprises web page content encoded in the HyperTextMarkup Language (“HTML”) notation. The HTML content of the confirmationprompt response 523 may be dynamically constructed, and may be detectedat Block 510 by presence of a string “HTTP” or other web page structureelements in the confirmation prompt response. The particular structureof confirmation prompt response 523 is not material to the scope of thepresent invention, and contents provided therein as a web page may beany valid HTML full page which can be distinguished, at Block 510, fromthe explicitly-expected response from the web application server.

The processing by the Ajax handler at Block 510 of FIG. 5 checks to seeif a received response is in an expected format. This test has apositive result when the received response comprises theoriginally-requested resource (which may comprise updated web pagecontent) sent from web server 550 as shown by reference number 552.(Typically, the response to the originally-requested resource comprisesa data string, which may be encoded in XML or another data interchangenotation.) Processing then continues at Block 515, where browser 500processes the Ajax response (which may comprise refreshing the displayedpage by loading the response received from the server 550).

On the other hand, when the test at Block 510 has a negative result,then the response is an unexpected response. As noted earlier, accordingto preferred embodiments, this unexpected input is preferably detectedby determining that the inbound message is not the text string orstructured data which was expected as an Ajax response for parsing bythe browser script; instead, the inbound message comprises the HTML pagecontent sent to browser 500 as the confirmation prompt 523 from gateway520, as shown by reference number 524. Processing therefore continues atBlock 511, which creates a new frame (or equivalently, a new iFrame) fora confirmation prompt widget, populates that new frame with theunexpected HTML content extracted from the confirmation prompt response523, and modifies the HTML to use Ajax. This modifying preferablycomprises searching through the document object model (“DOM”) thatcorresponds to the HTML page 523 to locate any forms or anchors encodedtherein that could submit a request to the server. The HTML codecorresponding to any such located forms or anchors is programmaticallymodified to submit through Ajax instead, thereby causing responses toany requests sent by these forms or anchors to target (i.e., to returnto) the Ajax handler in the browser. This preferably comprises modifyingany <onClick> syntax to submit the address therein through Ajax—andaccordingly, the user's response to the confirmation prompt at Block 513will be transmitted immediately, without requiring an additional userclick.

The dynamically-constructed confirmation prompt widget from Block 511 isrendered, and user input is received (Block 512). The prompt widgetcreates a new Ajax request message from the user's response (Block 513),and this message is then sent 532 from the browser 500 back to gateway520 using Ajax. Gateway 520 determines that this incoming messageprovides the additional information (or confirmation, alternatively)that was requested by message 523. A verification process 530 ispreferably performed, whereby the gateway determines whether theinformation in the user's response is approved. If it is not approved(i.e., the test in Block 530 has a negative result), then processingreturns to Block 523 to send 524 another message to the browser to againrequest the confirmation prompt. On the other hand, if the informationin the user's response is approved (i.e., the test in Block 530 has apositive result), then gateway 520 forwards 533 the user's request for aprotected resource to the web application server 550. Web applicationserver 550 processes 551 the request and sends 552 the requested contentback to the browser 500 for processing by the Ajax handler at 510.Notably, because this response is in the expected format, rather than aconfirmation prompt request, the test at Block 510 will pass theresponse—including the requested content contained therein—to Block 515,where the browser 500 uses Ajax support to process the response (whichmay comprise refreshing a selected portion of the displayed page byloading requested content into that portion of the web page).

It should be noted that while FIG. 5 illustrates the revised web pagecontent being sent at 552 from the server 550 to the Ajax handler at510, web server 550 may alternatively send this content to the gateway520 for forwarding to the Ajax handler 510.

FIG. 6 illustrates an example scenario where the gateway 620 detectsthat the browser script has requested a protected resource, andtherefore intervenes to prompt the user for additional informationbefore allowing the request to be forwarded to the web applicationserver. In this example, browser 600 is displaying a “Manage Servers”web page 601, and the user has selected the “Server_B” entry from the“Select Server” column and has selected “Format” from the “SelectAction” column. (Horizontal bars are used, for drafting convenience, tosignify selection of the Server_B and Format entries within web page601.) The user then presses the “Submit” graphical button, which causesan Ajax request to be sent 602 to the gateway 620.

In this example scenario, gateway 620 is configured to requireconfirmation of any request that contains the action “Format”.Accordingly, Block 621 tests whether the request contains this value(e.g., in a parameter name, parameter value pair, where the parametername is “Action” or the like and the value is “Format”). Because thetest in Block 621 has a positive result, in this example, the gatewaydetermines that the requested action requires administrator approval.The gateway therefore creates (Block 622) an HTML page containingcontent for obtaining an administrator's password, and sends 623 thisHTML page to the browser, in a response message, for processing by theAjax handler (which was discussed with reference to 510 in FIG. 5).

Upon receiving the confirmation prompt request at the Ajax handler ofbrowser 600, the test at Block 610 finds that this received response isnot in the expected format—that is, it is an HTML page and not a datastring that was expected for use in the browser script. Accordingly, theprocessing of Block 511 of FIG. 5 creates a new iFrame for aconfirmation prompt widget, populates that new frame with contentextracted from the HTML page created at Block 622, and modifies the HTMLto use Ajax (as discussed above with reference to FIG. 5). Thisdynamically-constructed confirmation prompt widget is illustrated at611, where it is shown as a floating iFrame that is rendered over theoriginal web page 601. After the user provides a password in this promptwidget 601 and presses the “OK” graphical button (corresponding to Block512 of FIG. 5), the prompt widget creates a new Ajax request messagefrom the user's response (as discussed with reference to Block 513 ofFIG. 5), and this message is then sent 632 from the browser 600 back togateway 620 using Ajax.

Gateway 620 then verifies (Block 630) whether the administrator'spassword, as represented by the message sent at 632, is correct. If not(i.e., the test in Block 630 has a negative result), then processingreturns 631 to Block 622 to send 623 another message to the browser toagain request the administrator's password. On the other hand, if theadministrator's password is correct (i.e., the test in Block 630 has apositive result), then gateway 620 forwards 633 the user's request for aprotected resource—in this case, the request to format a selectedserver—to the web application server 650. Web application server 650processes 651 the request and sends 652 the requested content back tothe browser 600 for processing by the Ajax handler. Notably, becausethis response is in the expected format—that is, it is a data string,which may comprise a status code or other content pertaining to theformatting of the selected server—the test at Block 610 will pass theresponse to the logic in the browser script that expects this response(which may comprise updating a selected portion of the displayed webpage 601 by loading the updated content) as discussed above. A resultingupdated web page, for this example, is shown at 612, where it can beseen that the entry “Server_B” is no longer presented in the “SelectServer” column.

The processing which has been described above allows a gateway torequest confirmation prompts for selected data, where widgets for theconfirmation prompts are dynamically constructed, and handles thedisplay and processing of those confirmation prompts in a non-disruptiveway in an Ajax environment. This is in contrast to existing approaches,which must either request an entire replacement web page, avoid the useof Ajax, and/or limit confirmation prompts to a predetermined set ofprebuilt confirmation widgets which the browser script is coded toexpect.

While preferred embodiments have been discussed above with reference toa gateway that is separate from the web application server and webbrowser, the gateway functionality may alternatively be incorporatedwithin either the web application server or the web browser withoutdeparting from the scope of the present invention.

Referring now to FIG. 7, a data processing system 700 suitable forstoring and/or executing program code includes at least one processor712 coupled directly or indirectly to memory elements through a systembus 714. The memory elements can include local memory 728 employedduring actual execution of the program code, bulk storage 730, and cachememories (not shown) which provide temporary storage of at least someprogram code in order to reduce the number of times code must beretrieved from bulk storage during execution.

Input/output (“I/O”) devices (including but not limited to keyboards718, displays 724, pointing devices 720, other interface devices 722,etc.) can be coupled to the system either directly or throughintervening I/O controllers or adapters (716, 726).

Network adapters may also be coupled to the system to enable the dataprocessing system to become coupled to other data processing systems orremote printers or storage devices through intervening private or publicnetworks (as shown generally at 732). Modems, cable modem attachments,wireless adapters, and Ethernet cards are just a few of thecurrently-available types of network adapters.

FIG. 8 illustrates a data processing network environment 800 in whichthe present invention may be practiced. The data processing network 800may include a plurality of individual networks, such as wireless network842 and wired network 844. A plurality of wireless devices 810 maycommunicate over wireless network 842, and a plurality of wired devices,shown in the figure (by way of illustration) as workstations 811, maycommunicate over network 844. Additionally, as those skilled in the artwill appreciate, one or more local area networks (“LANs”) may beincluded (not shown), where a LAN may comprise a plurality of devicescoupled to a host processor.

Still referring to FIG. 8, the networks 842 and 844 may also includemainframe computers or servers, such as a gateway computer 846 orapplication server 847 (which may access a data repository 848). Agateway computer 846 serves as a point of entry into each network, suchas network 844. The gateway 846 may be preferably coupled to anothernetwork 842 by means of a communications link 850 a. The gateway 846 mayalso be directly coupled to one or more workstations 811 using acommunications link 850 b, 850 c, and/or may be indirectly coupled tosuch devices. The gateway computer 846 may be implemented utilizing anEnterprise Systems Architecture/390® computer available from IBM.Depending on the application, a midrange computer, such as an iSeries®,System i™, and so forth may be employed. (“Enterprise SystemsArchitecture/390” and “iSeries” are registered trademarks, and “Systemi” is a trademark, of IBM in the United States, other countries, orboth.)

The gateway computer 846 may also be coupled 849 to a storage device(such as data repository 848).

Those skilled in the art will appreciate that the gateway computer 846may be located a great geographic distance from the network 842, andsimilarly, the workstations 811 may be located some distance from thenetworks 842 and 844, respectively. For example, the network 842 may belocated in California, while the gateway 846 may be located in Texas,and one or more of the workstations 811 may be located in Florida. Theworkstations 811 may connect to the wireless network 842 using anetworking protocol such as the Transmission Control Protocol/InternetProtocol (“TCP/IP”) over a number of alternative connection media, suchas cellular phone, radio frequency networks, satellite networks, etc.The wireless network 842 preferably connects to the gateway 846 using anetwork connection 850 a such as TCP or User Datagram Protocol (“UDP”)over IP, X.25, Frame Relay, Integrated Services Digital Network(“ISDN”), Public Switched Telephone Network (“PSTN”), etc. Theworkstations 811 may connect directly to the gateway 846 using dialconnections 850 b or 850 c. Further, the wireless network 842 andnetwork 844 may connect to one or more other networks (not shown), in ananalogous manner to that depicted in FIG. 8.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method, or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.), or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit”, “module”, or “system”.Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readable mediahaving computer readable program code embodied thereon.

Any combination of one or more computer readable media may be utilized.The computer readable medium may be a computer readable signal medium ora computer readable storage medium. A computer readable storage mediummay be, for example, but not limited to, an electronic, magnetic,optical, electromagnetic, infrared, or semiconductor system, apparatus,or device, or any suitable combination of the foregoing. More specificexamples (a non-exhaustive list) of the computer readable storage mediumwould include the following: an electrical connection having one or morewires, a portable computer diskette, a hard disk, a random access memory(“RAM”), a read-only memory (“ROM”), an erasable programmable read-onlymemory (“EPROM” or flash memory), a portable compact disc read-onlymemory (“CD-ROM”), DVD, an optical storage device, a magnetic storagedevice, or any suitable combination of the foregoing. In the context ofthis document, a computer readable storage medium may be any tangiblemedium that can contain or store a program for use by or in connectionwith an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electromagnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, radio frequency, etc., or any suitablecombination of the foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++, or the like, and conventional proceduralprogramming languages such as the “C” programming language or similarprogramming languages. The program code may execute as a stand-alonesoftware package, and may execute partly on a user's computing deviceand partly on a remote computer. The remote computer may be connected tothe user's computing device through any type of network, including alocal area network (“LAN”), a wide area network (“WAN”), or through theInternet using an Internet Service Provider.

Aspects of the present invention are described above with reference toflow diagrams and/or block diagrams of methods, apparatus (systems), andcomputer program products according to embodiments of the invention. Itwill be understood that each flow or block of the flow diagrams and/orblock diagrams, and combinations of flows or blocks in the flow diagramsand/or block diagrams, can be implemented by computer programinstructions. These computer program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flow diagram flow orflows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flow diagram flow or flowsand/or block diagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus, or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flow diagram flow orflows and/or block diagram block or blocks.

Flow diagrams and/or block diagrams presented in the figures hereinillustrate the architecture, functionality, and operation of possibleimplementations of systems, methods, and computer program productsaccording to various embodiments of the present invention. In thisregard, each flow or block in the flow diagrams or block diagrams mayrepresent a module, segment, or portion of code, which comprises one ormore executable instructions for implementing the specified logicalfunction(s). It should also be noted that, in some alternativeimplementations, the functions noted in the flows and/or blocks mayoccur out of the order noted in the figures. For example, two blocksshown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or each flow of the flowdiagrams, and combinations of blocks in the block diagrams and/or flowsin the flow diagrams, may be implemented by special purposehardware-based systems that perform the specified functions or acts, orcombinations of special purpose hardware and computer instructions.

While embodiments of the present invention have been described,additional variations and modifications in those embodiments may occurto those skilled in the art once they learn of the basic inventiveconcepts. Therefore, it is intended that the appended claims shall beconstrued to include the described embodiments and all such variationsand modifications as fall within the spirit and scope of the invention.

The invention claimed is:
 1. A system for handling unexpected content ata client-side application, comprising: a computer comprising aprocessor; and instructions which are executable, using the processor,to implement functions comprising: sending, from a client-sideapplication, a content request to a server for which a gateway providesaccess protection, the content request adapted for requesting a contentfragment from the server; receiving, at the client-side application fromthe gateway, a response message sent from the gateway to the client-sideapplication responsive to the gateway determining that the requestedcontent fragment is access-protected; inspecting the response message,at the client-side application, to determine whether the responsemessage contains the requested content fragment; responsive todetermining, at the client-side application, that the response messagecontains the requested content fragment, processing the requestedcontent fragment contained in the response message; and responsive todetermining, at the client-side application, that the response messagecomprises a request message containing unexpected content, theunexpected content comprising content which differs from the requestedcontent fragment, dynamically constructing a prompt for the client-sideapplication to respond to the request message containing the unexpectedcontent, the client-side application lacking a predefined prompt forhandling the unexpected content, comprising: creating a user inputframe; inserting the unexpected content from the request message intothe user input frame; displaying the user input frame; obtaining a userresponse from the displayed user input frame; and returning the obtaineduser response from the client-side application to the gateway as aresponse to the request message.
 2. The system according to claim 1,wherein the client-side application determines that the response messagecomprises the request message containing the unexpected content when theresponse message comprises a web page document encoded in HyperTextMarkup Language notation.
 3. The system according to claim 2, whereinthe user input frame comprises an iFrame, and the unexpected contentinserted into the user input frame comprises an entirety of the web pagedocument.
 4. The system according to claim 1, wherein the gatewaydetermining that the requested content fragment is access-protectedcomprises the gateway determining that confirmation or additionalinformation is required before the requested content fragment can besent from the server to the client-side application.
 5. The systemaccording to claim 2, wherein: the content request sent by theclient-side application is sent from script executing in the client-sideapplication; and returning the obtained user response from theclient-side application to the gateway further comprises dynamicallymodifying at least one client-side address contained in a form syntaxencoded in the web page document, prior to the returning, such that theserver will return the requested content fragment to a scriptinglanguage handler that is executing, in the client-side application, forsending the content request and for displaying the requested contentfragment.
 6. A computer program product for handling unexpected contentat a client-side application, the computer program product comprising: anon-transitory computer readable storage medium having computer readableprogram code embodied therein, the computer readable program codeconfigured for: sending, from a client-side application, a contentrequest to a server for which a gateway provides access protection, thecontent request adapted for requesting a content fragment from theserver; receiving, at the client-side application from the gateway, aresponse message sent from the gateway to the client-side applicationresponsive to the gateway determining that the requested contentfragment is access-protected; inspecting the response message, at theclient-side application, to determine whether the response messagecontains the requested content fragment; responsive to determining, atthe client-side application, that the response message contains therequested content fragment, processing the requested content fragmentcontained in the response message; and responsive to determining, at theclient-side application, that the response message comprises a requestmessage containing unexpected content, the unexpected content comprisingcontent which differs from the requested content fragment, dynamicallyconstructing a prompt for the client-side application to respond to therequest message containing the unexpected content, the client-sideapplication lacking a predefined prompt for handling the unexpectedcontent, comprising: creating a user input frame; inserting theunexpected content from the request message into the user input frame;displaying the user input frame; obtaining a user response from thedisplayed user input frame; and returning the obtained user responsefrom the client-side application to the gateway as a response to therequest message.
 7. The computer program product according to claim 6,wherein the client-side application determines that the response messagecomprises the request message containing the unexpected content when therequest message comprises a web page document encoded in HyperTextMarkup Language notation.
 8. The computer program product according toclaim 7, wherein the user input frame comprises an iFrame, and theunexpected content inserted into the user input frame comprises anentirety of the web page document.
 9. The computer program productaccording to claim 6, wherein the gateway determining that the requestedcontent fragment is access-protected comprises the gateway determiningthat confirmation or additional information is required before therequested content fragment can be sent from the server to theclient-side application.
 10. The computer program product according toclaim 7, wherein: the content request sent by the client-sideapplication is sent from script executing in the client-sideapplication; and returning the obtained user response from theclient-side application to the gateway further comprises dynamicallymodifying at least one client-side address contained in an anchor syntaxencoded in the web page document, prior to the returning, such that theserver will return the requested content fragment to a scriptinglanguage handler that is executing, in the client-side application, forsending the content request and for displaying the requested contentfragment.
 11. The system according to claim 1, wherein: the requestedcontent fragment comprises a data string encoded in Extensible MarkupLanguage notation; and the unexpected content contained in the requestmessage comprises a renderable document encoded in HyperText MarkupLanguage notation.
 12. The computer program product according to claim6, wherein: the requested content fragment comprises a data stringencoded in Extensible Markup Language notation; and the unexpectedcontent contained in the request message comprises a renderable documentencoded in HyperText Markup Language notation.
 13. The system accordingto claim 5, wherein: the script executes using Ajax technology; and thescripting language handler is an Ajax handler.
 14. The system accordingto claim 5, wherein the dynamically modifying at least one client-sideaddress further comprises: programmatically locating, in the formsyntax, an <onClick> syntax element; and programmatically modifying anaddress contained in the <onClick> syntax element to send the obtaineduser response through the scripting language handler.
 15. The computerprogram product according to claim 10, wherein: the script executesusing Ajax technology; and the scripting language handler is an Ajaxhandler.
 16. The computer program product according to claim 10, whereinthe dynamically modifying at least one client-side address furthercomprises: programmatically locating, in the anchor syntax, an <onClick>syntax element; and programmatically modifying an address contained inthe <onClick> syntax element to send the obtained user response throughthe scripting language handler.